<h3 class="ui dividing header">{{_("Application List")}} </h3>
<table class="ui sortable celled basic table">
	<thead>
		<tr>
			<th>{{_("ID")}}</th>
			<th class="default-sort">{{_("Name")}}</th>
			<th>{{_("Application")}}</th>
			<th>{{_("SN")}}</th>
			<th>{{_("Version")}}</th>
			<th>{{_("Auto Start")}}</th>
			<th>{{_("Action")}}</th>
		</tr>
	</thead>
	<tbody>
		{% for k, v in pairs(apps) do %}
		<tr>
			<td>{{v.running and string.format("%08x", v.running.handle) or ""}} </td>
			<td>{{k}} </td>
			<td>{{v.name}} </td>
			<td>{{v.sn}} </td>
			<td id="{{k}}_version_col"> {{v.version}}
				{% if v.islocal and v.version == 0 then %}
				<i class="blue write square icon"></i>
				{% end %}
			</td>
			<td>
				{% if v.auto == 0 then %}
				<div class="ui toggle checkbox auto_start">
					<input class="hidden" type="checkbox" data-inst="{{k}}">
					<label></label>
				</div>
				{% else %}
				<div class="ui toggle checked checkbox auto_start">
					<input class="hidden" type="checkbox" checked="true" data-inst="{{k}}">
					<label></label>
				</div>
				{% end %}
			</td>
			<td id="{{k}}_actions_col">
				<i id="{{k}}_upgrade_col">
					<div class="ui labeled button button upgrade" data-inst="{{k}}" data-app="{{v.name}}" data-version="latest">
						<div class="ui orange button">
							<i class="info circle icon"></i> {{_("Upgrade To")}}
						</div>
						<a class="ui basic orange left pointing label">
							latest
						</a>
					</div>
				</i>

				<div class="ui blue icon button refresh" data-content="{{_('Reinstall From Store')}}" data-inst="{{k}}" data-app="{{v.name}}" data-version="{{v.version}}" style="display: none;">
					<i class="refresh icon"></i>
				</div>
				{% if not v.running then %}
				<div class="ui green icon button start" data-content="{{_('Start Application')}}" data-inst="{{k}}">
					<i class="play icon"></i>
				</div>
				<div class="ui red icon button stop" data-content="{{_('Stop Application')}}" data-inst="{{k}}" style="display: none;">
					<i class="stop icon"></i>
				</div>
				{% else %}
				<div class="ui green icon button start" data-content="{{_('Start Application')}}" data-inst="{{k}}" style="display: none;">
					<i class="play icon"></i>
				</div>
				<div class="ui red icon button stop" data-content="{{_('Stop Application')}}" data-inst="{{k}}">
					<i class="stop icon"></i>
				</div>
				{% end %}
				<div class="ui olive icon button conf" data-content="{{_('Configuration')}}" data-inst="{{k}}">
					<i class="settings icon"></i>
				</div>
				<div class="ui yellow icon button rename" data-content="{{_('Rename Application')}}" data-inst="{{k}}">
					<i class="edit outline icon"></i>
				</div>
				<div class="ui brown icon button uninstall" data-content="{{_('Uninstall Application')}}" data-inst="{{k}}">
					<i class="trash icon"></i>
				</div>
				{% if using_beta then %}
				<div class="ui olive icon button editor" data-content="{{_('Online Editor')}}" data-inst="{{k}}">
					<i class="edit icon"></i>
				</div>
				{% end %}
			</td>
		</tr>
		{% end %}
	</tbody>
</table>
